/* 链接：https://www.nowcoder.com/questionTerminal/859d3e13ebb24e73861e03141bbe9cfb?source=relative.nowcoder.com/questionTe
来源：牛客网
 */
/**
 * 
 * @param {String} s
 * @returns {String}
 */
function findString(s) {//string&
    if (s.length < 2)
        return s;
    let index = 0;
    var res=[];
    let maxLen = 0;
    let len = s.length;
    // var collect=[];
    for (; index < len - 1; ++index) {
        let j = index + 1;
        while (s[index] != s[j] && j < len)
            ++j;

        let count = 0;
        var tmp=[];
        if (j != len) {
            let i = index;
            while (s[i] == s[j]) {// 查找子串
                ++count;
                tmp.push(s[i]);
                ++i;
                ++j;
            }
            if (count > maxLen) {
                maxLen = count;
                res=tmp;//.swap(tmp);
               // tmp.clear();
            }
        }
    }

    return res.join("");
};
/* var str=findString("https://www.nowcoder.com/questionTerminal/859d3e13ebb24e73861e03141bbe9cfb?source=relative.nowcoder.com/questionTe") ;
console.log(str); */
/**
 * @param {String} str
 */
function preDeal(str) {
   return str.split("\n").map(o=>{
       return o.trim();
    }).join("\n");
}
var str= require("fs").readFileSync("D:\\site\\git_Site\\scrm\\addons\\yunbei_mic\\site.php").toString();
str=preDeal(str);
console.log(findString(str)) ;